#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 1005;

int n, m, x, y;
double dp[N][N];
double a[N][N];
void gauss() {
  rep(i, 1, n) {
    if (i < n) a[i][i + 1] /= a[i][i];
    a[i][n + 1] /= a[i][i];
    a[i][i] = 1.0;
    if (i < n) {
      double x = a[i + 1][i];
      a[i + 1][i] -= a[i][i] * x;
      a[i + 1][i + 1] -= a[i][i + 1] * x;
      a[i + 1][n + 1] -= a[i][n + 1] * x;
    }
  }
  per(i, n - 1, 1) {
    double x = a[i][i + 1];
    a[i][i + 1] = 0;
    a[i][n + 1] -= x * a[i + 1][n + 1];
  }
}
void solve() {
  cin >> m >> n;
  cin >> x >> y;
  if (n == 1) {
    int s = m - x;
    cout << fixed << setprecision(10) << 2.0 * s;
    return;
  }
  // f[i][j] = 0.25 * (f[i][j - 1] + f[i][j] + f[i][j + 1] + f[i + 1][j]) + 1;
  // -f[i][j - 1] + 3*f[i][j] -f[i][j + 1] = f[i + 1][j] + 4
  // 2f[i][1] -f[i][2] = f[i + 1][1] + 3.0, 2f[i][n] - f[i][n - 1] = f[i + 1][n]
  // + 3.0
  per(i, m - 1, x) {
    a[1][n + 1] = dp[i + 1][1] + 3.0, a[n][n + 1] = dp[i + 1][n] + 3.0;
    rep(j, 2, n - 1) a[j][n + 1] = dp[i + 1][j] + 4.0;
    a[1][1] = 2.0, a[1][2] = -1;
    rep(j, 2, n - 1) a[j][j - 1] = -1.0, a[j][j] = 3.0, a[j][j + 1] = -1.0;
    a[n][n - 1] = -1.0, a[n][n] = 2.0;
    gauss();
    per(j, n, 1) dp[i][j] = a[j][n + 1] / a[j][j];
  }
  cout << fixed << setprecision(10) << dp[x][y];
  return;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}